
<html lang="en">
<head>
    <link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/public/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/public/hui/static/h-ui.admin/css/style.css" />
</head>
<body>
<article class="cl pd-20  col-xs-10 col-xs-offset-1">
    <form action="" method="post" class="form form-horizontal" id="form">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">* </span>模块名称</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="<?=$vo['name']?>" placeholder="" id="module_name" name="module_name">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">&nbsp;&nbsp;排序</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="<?=$vo['sort']?>" placeholder="0" id="sort" name="sort">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">
                <span class="c-red"> * </span>图标
            </label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" id="icon" name="icon" autocomplete="off" placeholder="" value="<?=htmlspecialchars($vo['icon'])?>">
            </div>
        </div>
        <div class="row cl" style="margin-left:35px;">
            图标库：<a href="http://www.h-ui.net/Hui-3.7-Hui-iconfont.shtml" target="_blank">http://www.h-ui.net/Hui-3.7-Hui-iconfont.shtml</a>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-3 col-xs-offset-3">
                <input type="hidden" name="id" value="<?=$vo['id']?>">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;修改&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<script type="text/javascript" src="/public/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/public/lib/layer/layer.js"></script>
<script type="text/javascript" src="/public/hui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/hui/static/h-ui.admin/js/H-ui.admin.page.js"></script>
<script type="text/javascript" src="/public/lib/validate/jquery.validate.min.js"></script>
<script>

    $("#form").validate({
        rules:{
            module_name:{
                required:true,
                minlength:1
            },
            icon:{
                required:true
            }
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $.ajax({
                dataType:'json',
                type: 'post',
                url: '/Systems/module_edit_do',
                data: $('#form').serialize(),
                success: function(data){
                    if(1 == data){
                        layer.msg('修改成功!', {
                            icon: 1,
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        }, function(){
                            parent.layer.closeAll();
                        });
                    }else if(999 == data){
                        layer.msg('暂无权限!',{icon:4,time:1000});
                    }else{
                        layer.msg('修改失败!');
                    }
                }
            });
        }
    });
</script>
</body>
</html>